home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / gamesmaster / source / c / agacolourlist.c next >
Encoding:
C/C++ Source or Header  |  1996-09-08  |  4.1 KB  |  101 lines

  1. /*
  2. ** AGA Colourlist Demo
  3. ** -------------------
  4. ** Displays an AGA colourlist (24bit colour lines).
  5. **
  6. ** To exit the demo, press the left mouse button.
  7. **
  8. ** Compiles under SAS/C.
  9. */
  10.  
  11. #include <exec/types.h>
  12. #include <exec/memory.h>
  13. #include <games/games.h>
  14. #include <games/gamesbase.h>
  15. #include <proto/games.h>
  16. #include <proto/exec.h>
  17.  
  18. #define AMT_PLANES 1
  19.  
  20. struct GMSBase *GMSBase;
  21.  
  22. LONG ColourList[] = {
  23.    0x010000,0x020000,0x030000,0x040000,0x050000,0x060000,0x070000,0x080000,
  24.    0x090000,0x0a0000,0x0b0000,0x0c0000,0x0d0000,0x0e0000,0x0f0000,0x100000,
  25.    0x110000,0x120000,0x130000,0x140000,0x150000,0x160000,0x170000,0x180000,
  26.    0x190000,0x1a0000,0x1b0000,0x1c0000,0x1d0000,0x1e0000,0x1f0000,0x200000,
  27.    0x210000,0x220000,0x230000,0x240000,0x250000,0x260000,0x270000,0x280000,
  28.    0x290000,0x2a0000,0x2b0000,0x2c0000,0x2d0000,0x2e0000,0x2f0000,0x300000,
  29.    0x310000,0x320000,0x330000,0x340000,0x350000,0x360000,0x370000,0x380000,
  30.    0x390000,0x3a0000,0x3b0000,0x3c0000,0x3d0000,0x3e0000,0x3f0000,0x400000,
  31.    0x410000,0x420000,0x430000,0x440000,0x450000,0x460000,0x470000,0x480000,
  32.    0x490000,0x4a0000,0x4b0000,0x4c0000,0x4d0000,0x4e0000,0x4f0000,0x500000,
  33.    0x510000,0x520000,0x530000,0x540000,0x550000,0x560000,0x570000,0x580000,
  34.    0x590000,0x5a0000,0x5b0000,0x5c0000,0x5d0000,0x5e0000,0x5f0000,0x600000,
  35.    0x610000,0x620000,0x630000,0x640000,0x650000,0x660000,0x670000,0x680000,
  36.    0x690000,0x6a0000,0x6b0000,0x6c0000,0x6d0000,0x6e0000,0x6f0000,0x700000,
  37.    0x710000,0x720000,0x730000,0x740000,0x750000,0x760000,0x770000,0x780000,
  38.    0x790000,0x7a0000,0x7b0000,0x7c0000,0x7d0000,0x7e0000,0x7f0000,0x800000,
  39.    0x810000,0x820000,0x830000,0x840000,0x850000,0x860000,0x870000,0x880000,
  40.    0x890000,0x8a0000,0x8b0000,0x8c0000,0x8d0000,0x8e0000,0x8f0000,0x900000,
  41.    0x910000,0x920000,0x930000,0x940000,0x950000,0x960000,0x970000,0x980000,
  42.    0x990000,0x9a0000,0x9b0000,0x9c0000,0x9d0000,0x9e0000,0x9f0000,0xa00000,
  43.    0xa10000,0xa20000,0xa30000,0xa40000,0xa50000,0xa60000,0xa70000,0xa80000,
  44.    0xa90000,0xaa0000,0xab0000,0xac0000,0xad0000,0xae0000,0xaf0000,0xb00000,
  45.    0xb10000,0xb20000,0xb30000,0xb40000,0xb50000,0xb60000,0xb70000,0xb80000,
  46.    0xb90000,0xba0000,0xbb0000,0xbc0000,0xbd0000,0xbe0000,0xbf0000,0xc00000,
  47.    0xc10000,0xc20000,0xc30000,0xc40000,0xc50000,0xc60000,0xc70000,0xc80000,
  48.    0xc90000,0xca0000,0xcb0000,0xcc0000,0xcd0000,0xce0000,0xcf0000,0xd00000,
  49.    0xd10000,0xd20000,0xd30000,0xd40000,0xd50000,0xd60000,0xd70000,0xd80000,
  50.    0xd90000,0xda0000,0xdb0000,0xdc0000,0xdd0000,0xde0000,0xdf0000,0xe00000,
  51.    0xe10000,0xe20000,0xe30000,0xe40000,0xe50000,0xe60000,0xe70000,0xe80000,
  52.    0xe90000,0xea0000,0xeb0000,0xec0000,0xed0000,0xee0000,0xef0000,0xf00000,
  53.    0xf10000,0xf20000,0xf30000,0xf40000,0xf50000,0xf60000,0xf70000,0xf80000,
  54.    0xf90000,0xfa0000,0xfb0000,0xfc0000,0xfd0000,0xfe0000,0xff0000,
  55.    -1
  56. };
  57.  
  58. LONG RasterList[] = {
  59.      COL24LIST(0,1,0,&ColourList),
  60.      RASTEND
  61. };
  62.  
  63. struct GameScreen GameScreen = {
  64.        GSV1,
  65.        0,0,0,               /* Screen_Mem1,2,3 */
  66.        0,                   /* ScreenLink */
  67.        0,                   /* Address of palette */
  68.        &RasterList,         /* Address of rasterlist */
  69.        0,                   /* Amount of colours in palette */
  70.        320,256,320,256,     /* Screen & Pic Height/Width */
  71.        AMT_PLANES,          /* Amt_Planes */
  72.        0,0,                 /* Top Of Screen, X/Y */
  73.        0,0,                 /* X/Y counters (for scrolling) */
  74.        BLKBDR,              /* Special attributes */
  75.        LORES|_24BITCOL,     /* Screen mode */
  76.        PLANAR,              /* Screen type */
  77.        0                    /* Reserved */
  78. };
  79.  
  80. struct GameScreen *OurScreen;
  81.  
  82. /*=========================================================================*/
  83.  
  84. void main(void)
  85. {
  86.    struct GamesLibrary *GMSBase = (struct GamesLibrary *)
  87.       OpenLibrary("games.library", 0);
  88.  
  89.    OurScreen = &GameScreen;
  90.    SetUserPri();
  91.  
  92.    if (Add_Screen(OurScreen) == NULL) {
  93.       Show_Screen(OurScreen);
  94.       Wait_LMB();
  95.       Delete_Screen(OurScreen);
  96.    }
  97.    CloseLibrary((struct Library *)GMSBase);
  98. }
  99.  
  100. /*=========================================================================*/
  101.